<?php

	class FlashImageRotatorWidget extends EbWidget
	{
		static private $lastId = 1;
		
		public function render()
		{
			$folder_id = $this->folder;
			$width = isset($this->width) ? $this->width : '100%';
			$height = isset($this->height) ? $this->height : '100%';
			$id = isset($this->id) ? $this->id : self::$lastId;

			echo '
			<div id="'.$id.'"></div>
			<script type="text/javascript">
				var s1 = new SWFObject("/static/flashimagerotator.swf","Flash_'.$id.'","'.$width.'","'.$height.'","7");
				s1.addParam("allowfullscreen","true");
				s1.addVariable("file","/Media/model-Media/selectByFolderForRotator.xml?folder='.$folder_id.'");
				s1.addVariable("width","'.$width.'");
				s1.addVariable("height","'.$height.'");
				s1.write("'.$id.'");
			</script>
			';
			
			self::$lastId++;
		}	
	}

?>